package com.example.test01;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.util.Log;
import android.view.Gravity;
import android.widget.Toast;

public class MyBroadCastReceiver extends BroadcastReceiver{
    @Override
    public void onReceive(Context context, Intent intent){
        Log.d("hyw","message:"+ intent.getStringExtra("BroadCastMessage"));
        Toast t = Toast.makeText(context,"动态广播"+intent.getStringExtra("BroadCastMessage"),Toast.LENGTH_SHORT);
        t.setGravity(Gravity.TOP,0,0);
        t.show();
    }
}